import { axios } from '@/utils/request'

/**
 * api接口列表
 */
const api = {
  list: '/erp_meixingtiyu/course/list',
  add: '/erp_meixingtiyu/course/add',
  del: '/erp_meixingtiyu/course/del',
  edit: '/erp_meixingtiyu/course/edit',
  orderList: '/erp_meixingtiyu/course/orderList',
  studentList: '/erp_meixingtiyu/course/studentList',
  orderListFilter: '/erp_meixingtiyu/course/orderListFilter',
}

/**
 * 获取课程列表
 */
export function list (params) {
  return axios({
    url: api.list,
    method: 'get',
    params
  })
}

/**
 * 添加课程
 */
 export function add (params) {
  return axios({
    url: api.add,
    method: 'get',
    params
  })
}

/**
 * 编辑课程
 */
 export function edit (params) {
  return axios({
    url: api.edit,
    method: 'get',
    params
  })
}


/**
 * 删除课程
 */
 export function del (params) {
  return axios({
    url: api.del,
    method: 'get',
    params
  })
}

/**
 * 课程订单列表
 */
 export function orderList (params) {
  return axios({
    url: api.orderList,
    method: 'get',
    params
  })
}

/**
 * 根据日期范围获取课程订单列表
 */
 export function orderListFilter (params) {
  return axios({
    url: api.orderListFilter,
    method: 'get',
    params
  })
}

/**
 * 获取指定课程的所有学员
 */
 export function studentList (params) {
  return axios({
    url: api.studentList,
    method: 'get',
    params
  })
}